<template>
  <rx-dialog @handOk="handleSubmit" @cancel="cancel">
    <a-form :form="form">
      <a-form-item style="display:none">
        <a-input v-decorator="['id']"/>
      </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.entityID','实体ID')">
					<a-input :placeholder="i18n('form.entityID','实体ID')" v-decorator="['entId', {rules: [{required: false, message: i18n('form.entityID','实体ID','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$ti18('rxForm.name', '名称')">
					<a-input :placeholder="$ti18('rxForm.name', '名称')" v-decorator="['name', {rules: [{required: false, message: $ti18('rxForm.name', '名称','','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$comi18('business.fieldName', '字段名称')">
					<a-input :placeholder="$comi18('business.fieldName', '字段名称')" v-decorator="['fieldName', {rules: [{required: false, message: $comi18('business.fieldName', '字段名称','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$ti18('rxForm.notes', '备注')">
					<a-input :placeholder="$ti18('rxForm.notes', '备注')" v-decorator="['comment', {rules: [{required: false, message: $ti18('rxForm.notes', '备注','','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.dataType','数据类型')">
					<a-input :placeholder="i18n('form.dataType','数据类型')" v-decorator="['dataType', {rules: [{required: false, message: i18n('form.dataType','数据类型','select')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.length','长度')">
                    <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.length','长度')" v-decorator="['length', {rules: [{required: false, message: i18n('form.length','长度','input')}]}]" />
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.decimalPlaces','小数位')">
                    <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.decimalPlaces','小数位')" v-decorator="['decimalLength', {rules: [{required: false, message: i18n('form.decimalPlaces','小数位','input')}]}]" />
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.controlType','控件类型')">
					<a-input :placeholder="i18n('form.controlType','控件类型')" v-decorator="['control', {rules: [{required: false, message: i18n('form.controlType','控件类型','select')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.extendJson','扩展JSON')">
                    <a-textarea :placeholder="i18n('form.extendJson','扩展JSON')" v-decorator="['extJson', {rules: [{required: false, message: i18n('form.extendJson','扩展JSON','input')}]}]" :rows="4" />
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.singlevalueornot','是否单字段')">
                    <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.singlevalueornot','是否单字段')" v-decorator="['isSingle', {rules: [{required: false, message: i18n('form.singlevalueornot','是否单字段','select')}]}]" />
			  </a-form-item>
    </a-form>
  </rx-dialog>
</template>
<script>
  import FormBoAttrApi from '@/api/form/bo/formBoAttr'
  import {BaseForm,RxDialog} from "@lowcode/jpaas-common-lib";
  export default {
    name: 'FormBoAttrEdit',
    mixins:[BaseForm],
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"formBoAttr",key);
        },
      getById(id){
        return FormBoAttrApi.get(record.pkId);
      },
      save(values){
        return FormBoAttrApi.save(values);
      }
    }
  }
</script>
